//
//  GameTableViewCell.swift
//  YueJian
//
//  Created by mac on 2017/10/25.
//  Copyright © 2017年 MapleStory. All rights reserved.
//

import UIKit

class GameTableViewCell: UITableViewCell {

    var num: Int = 0
    @IBOutlet weak var title: UILabel!
    @IBOutlet weak var imageview: UIImageView!
    @IBOutlet weak var love: UIButton!
    @IBOutlet weak var number: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    @IBAction func changeLove(_ sender: Any) {
        let btn = sender as? UIButton
        if (btn?.isSelected)! {
            btn?.isSelected = false
            num -= 1
            number.text = String(num)
        } else {
            //这里写提交接口
            num += 1
            number.text = String(num)
            btn?.isSelected = true
        }
    }
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
